function _extends(Child, Father) {
  Child.__proto__ = Father; //←继承静态属性
  function Temp() {
    this.constructor = Child;
  }

  Temp.prototype = Father.prototype;
  Child.prototype/*←__proto__->Temp.prototype=Father.prototype*/ = new Temp(); //继承公有属性 //为什么不直接=new Father而要使用一个Temp,为了修正constructor 和 避免prototype上有私有属性
}

var Father = (function () {
  //私有变量声明在这里 private xxx=yyy/fn(){}

  function Father(name){
    this.name = name;
  }

  Father.prototype.getName = function () {
    console.log(this.name)
  };
  Father.staticFatherName = 'FatherName';
  Father.staticGetFatherName = function () {
    console.log(Father.staticFatherName)
  };
  return Father;
})();



var Child = (function (_super) { // _super = Father
  //继承公有属性和静态属性
  _extends(Child, _super);

  function Child(name){
    //调用父类的构造函数,继承私有属性
    _super.call(this,name); //这里this其实是指向子类的实例,new Child的实例
  }

  Child.prototype.getName = function () {
    console.log(this.name)
  };
  Child.staticChildName = 'ChildName';
  Child.staticGetChildName = function () {
    console.log(Child.staticChildName)
  };
  return Child;
})(Father);
